//
//  RequestHandle.h
//  suishouxiu
//
//  Created by parkin on 15/5/27.
//  Copyright (c) 2015年 zhongyan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BaseRequest.h"
#import "AFNetworking.h"
#import "AppError.h"
#import "ViewController.h"
#import "AppDelegate.h"
#import "MyGlobal.h"
#import "RepeatLoginController.h"

@class BaseRequest;
@class BaseResponse;

typedef void (^CompleteBlock)(id responseObject);
typedef void(^ErrorBlock)(NSError * error);


@interface RequestHandle : NSObject
+ (void)startOperationWithRequest:(id<SSXRequestProtocol>)request
                         complete:(CompleteBlock)complete
                            error:(ErrorBlock)error;


+ (void)startUploadOperationWithRequest:(id<SSXRequestProtocol>)request
                               fileName:(NSString *)fileName
                             uploadData:(NSData *)uploadData
                             originData:(NSData *)originData
                               complete:(CompleteBlock)completeBlock
                                  error:(ErrorBlock)errorBlock;

+(void)uplaodImageOperationWithRequest:(BaseRequest *)request uploadData:(NSData *)uploadData
                              complete:(CompleteBlock)completeBlock
                                 error:(ErrorBlock)errorBlock;
@end
